//
//  URLUtil.swift
//  shop
//
//  Created by chen on 2025/5/17.
//

import SwiftUI

class URLUtil {
    
    static func extractURLContent(_ urlString: String) -> String? {
        guard let url = URL(string: urlString) else {
            return nil
        }
        
        let path = url.path
        let query = url.query.map { "?" + $0 } ?? ""
        let host = url.host ?? ""
        
        return host + path + query
    }
}
